	#Title: Programa 22				Filename: 22.s
	#Author: Chipres Castellanos Ana Maria          Date: 23 /mayo / 2017
	#Descripcion:
	#Programa que convierte un numero positivo a binario
	
	.arch armv6
	.eabi_attribute 27, 3
	.eabi_attribute 28, 1
	.fpu vfp
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 6
	.eabi_attribute 34, 1
	.eabi_attribute 18, 4
	.file	"25.c"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Ingrese un n\243mero entero positivo: \000"
	.align	2
.LC1:
	.ascii	"%ld\000"
	.align	2
.LC2:
	.ascii	"\012%ld = \000"
	.align	2
.LC3:
	.ascii	"b\012\000"
	.align	2
.LC4:
	.ascii	"pause\000"
	.text
	.align	2
	.global	main
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	stmfd	sp!, {fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r0, .L10
	bl	printf
	sub	r3, fp, #12
	ldr	r0, .L10+4
	mov	r1, r3
	bl	__isoc99_scanf
	ldr	r3, [fp, #-12]
	ldr	r0, .L10+8
	mov	r1, r3
	bl	printf
	ldr	r3, [fp, #-12]
	cmp	r3, #0
	bne	.L2
	mov	r0, #48
	bl	putchar
.L2:
	mov	r3, #1
	str	r3, [fp, #-8]
	b	.L3
.L4:
	ldr	r3, [fp, #-8]
	mov	r3, r3, asl #1
	str	r3, [fp, #-8]
.L3:
	ldr	r3, [fp, #-12]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	ble	.L4
	ldr	r3, [fp, #-8]
	mov	r2, r3, lsr #31
	add	r3, r2, r3
	mov	r3, r3, asr #1
	str	r3, [fp, #-8]
	b	.L5
.L6:
	ldr	r3, [fp, #-8]
	mov	r2, r3, lsr #31
	add	r3, r2, r3
	mov	r3, r3, asr #1
	str	r3, [fp, #-8]
.L5:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bgt	.L6
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	cmp	r2, r3
	blt	.L7
	mov	r0, #49
	bl	putchar
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	rsb	r3, r3, r2
	str	r3, [fp, #-12]
	b	.L8
.L7:
	mov	r0, #48
	bl	putchar
.L8:
	ldr	r0, .L10+12
	bl	puts
	ldr	r0, .L10+16
	bl	system
	mov	r3, #0
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	ldmfd	sp!, {fp, pc}
.L11:
	.align	2
.L10:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Raspbian 4.9.2-10) 4.9.2"
	.section	.note.GNU-stack,"",%progbits
